<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><s:text name="lucene.input.title"/></title>
	<%@ include file="/common/meta.jsp"%>
	<%@ include file="/common/common.jsp"%>
</head>
<body>
<div id="wrapper">
	<div class="curmb"><s:text name="your.site.position"/>:<a href="${ctx}/main.action"><s:text name="homepage"/></a><span>></span><s:text name="lucene.input.title"/></div>
	<div class="listtit"><p><span><strong><s:text name="lucene.input.title"/></strong></span></p></div>
	<div class="listadd">
		<table class="addgrid">
			<tr>
				<td align="center" colspan="2"><font color="red"><s:property value="msg"/></font></td>
			</tr>
			<tr>
				<th width="20%">更新全部索引</th>
				<td>
				<input type="button" value="更新" onclick="createall()" class="btnlist2"/>
				<span style="color:#457d07">(友情提示: 此操作将更新搜索的全部索引信息!)</span>
				</td>
			</tr>
			<tr>
				<th>更新文章索引</th>
				<td>
				<input type="button" value="更新" onclick="createcontent()" class="btnlist2"/>
				<span style="color:#457d07">(友情提示: 此操作将更新搜索中关于文章的索引信息!)</span>
				</td>
			</tr>
			<tr>
				<th>更新静态资源索引</th>
				<td>
				<input type="button" value="更新" onclick="createhtml()" class="btnlist2"/>
				<span style="color:#457d07">(友情提示: 此操作将更新搜索中关于栏目首页和列表页的索引信息!)</span>
				</td>
			</tr>
			<tr>
				<th>更新关键词索引</th>
				<td>
				<input type="button" value="更新" onclick="createkeyword()" class="btnlist2"/>
				<span style="color:#457d07">(友情提示: 此操作将更新搜索中关于搜索框关键词提示的索引信息!)</span>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
				&nbsp;</td>
			</tr>
		</table>
	</div>
</div>

<script type="text/javascript">
	function createall(){
		$.ajax({
			type:"POST",
			async:false,
			url:"${ctx}/search/lucene-ajaxall.action?random="+Math.random(),
			success:function(data){
				var json =eval('('+data+')');
				if(json.flag){
					alert("正在更新...");
				}
				else{
					alert(json.msg);
				}
			}
		});	
	}	
	
	function createhtml(){
		$.ajax({
			type:"POST",
			async:false,
			url:"${ctx}/search/lucene-ajaxhtml.action?random="+Math.random(),
			success:function(data){
				var json =eval('('+data+')');
				if(json.flag){
					alert("正在更新...");
				}
				else{
					alert(json.msg);
				}
			}
		});	
	}
	function createcontent(){
		$.ajax({
			type:"POST",
			async:false,
			url:"${ctx}/search/lucene-ajaxcontent.action?random="+Math.random(),
			success:function(data){
				var json =eval('('+data+')');
				if(json.flag){
					alert("正在更新...");
				}
				else{
					alert(json.msg);
				}
			}
		});	
	}
	function createkeyword(){
		$.ajax({
			type:"POST",
			async:false,
			url:"${ctx}/search/lucene-ajaxkeywords.action?random="+Math.random(),
			success:function(data){
				var json =eval('('+data+')');
				if(json.flag){
					alert("正在更新...");
				}
				else{
					alert(json.msg);
				}
			}
		});	
	}
	
	function createenterprise(){
		$.ajax({
			type:"POST",
			async:false,
			url:"${ctx}/search/lucene-ajaxenterprise.action?random="+Math.random(),
			success:function(data){
				var json =eval('('+data+')');
				if(json.flag){
					alert("正在更新...");
				}
				else{
					alert(json.msg);
				}
			}
		});	
	}
</script>
</body>
</html>
